#include<bits/stdc++.h>
using namespace std;
const int maxn = 55;
int T,n2,n3,n5,nk,na,vis[5][15];
char s[maxn];
int turna(char a){
	if(a=='H')return 1;
	else if(a=='S')return 2;
	else if(a=='C')return 3;
	else if(a=='D')return 4;
	cerr<<"error1"<<endl;
	return 0;
}
int turnb(char b){
	if(b=='T')return 10;
	else if(b=='A')return 1;
	else if(b=='J')return 11;
	else if(b=='Q')return 12;
	else if(b=='K')return 13;
	else if(b<='9'&&b>='2')return b-'0';
	cerr<<"error2"<<endl;
	cerr<<b<<endl;
	return 0;
}
void check(char a,char b){
	int x = turna(a),y = turnb(b);
	if(vis[x][y]){cerr<<"error"<<endl;cerr<<a<<b<<endl;}
	vis[x][y] = true;
}
int main(){
	scanf("%d",&T);
	while(T--){
		memset(vis,0,sizeof(vis));
		scanf("%s",s);
		n2 = n3 = n5 = nk = na = 0;
		for(int i=0;i<9;++i){
			check(s[i*2],s[i*2+1]);
			int x = turnb(s[i*2+1]);
			if(x==2)n2++;
			else if(x==3)n3++;
			else if(x==5)n5++;
			else if(x==13)nk++;
			else if(x==1)na++;
		}
		if(n2==4||n3==4||n5==4){
			if(na>=3 || (na==2&&nk==3)){
				puts("yyds");
			}
			else puts("cry");
		}
		else puts("cry");
	}
	return 0;
}